package com.android.nearshop.app.adapter.listadapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.android.nearshop.app.adapter.listadapter.Text3ListAdapter.Text3Item;
import com.android.nearshop.app.widget.Text3ItemView;

/*******************************************************
 * @author: zhaohua
 * @version: 2012-6-8
 * @see: TODO
 * @Copyright : copyrights reserved by personal 2007-2012
*******************************************************/
public class Text3ListAdapter extends ArrayListAdapter<Text3Item>
{

	public Text3ListAdapter(Context context)
	{
		super(context);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		Text3ItemView row = null;
		Text3Item item = (Text3Item)getItem(position);
		
		if(convertView == null)
		{
			row = new Text3ItemView(mContext);
		}else
		{
			if(convertView instanceof Text3ItemView)
			{
				row = (Text3ItemView)convertView;
			}
		}
		
		row.bindData(item);
		
		return row;
	}
	
	public static interface Text3Item
	{
		/**
		 * 检测选择状态
		 * @param getIs 优先判断 获取是否有checkBox
		 * @param getValue 其次判断 如果有获取checkBox的选择状态值
		 * @param setValue 其次判断 如果有设置checkBox的选择状态值
		 * @return getIs getValue的值
		 */
		public boolean checked(boolean getIs, boolean getValue, boolean setValue);
		
		/**
		 * 检测是否有dot图标和Open图标
		 * @param getDot 是否有dot图标
		 * @param getOpen 是否有open图标
		 * @return getDot getOpen的值
		 */
		public boolean  isDotOpen(boolean getDot, boolean getOpen);
		public String get_name();
	}
}
